import java.util.Scanner;
//力扣334.
public class Solution {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        isBalanced(sc.nextLine());
    }
    public  static boolean isBalanced(String num) {
        char[] chars = num.toCharArray();
        int singleNum = 0;
        int doubleNum = 0;
        for(int i = 0; i< chars.length; i++){
                if(i % 2 == 0){
                    doubleNum += Integer.valueOf(chars[i]-'0');
                }else {
                singleNum += Integer.valueOf(chars[i]);
            }
        }
        if(singleNum == doubleNum){
            return true;
        }
        return false;

    }
}